<?php 
	//load css
	echo $html->css('style.menu');
	//load javascript
	echo $javascript->link('jquery.jcarousellite');
	echo $javascript->link('custom.jcarousellite');
?>
<script language="javascript">
function bindAjaxLink() {
	$('div#food_items a.ajax_link').click(function() {
		var _url = $(this).attr('href');

		$('div#food_detail').html("<div align='center' style='padding:20px'><?php __("Đang nạp dữ liệu ...")?></div>");
		window.location = '#waiting';
		$.ajax({
			url: _url,
			success: function(responseContent) {
				$('div#food_detail').html(responseContent);
			}
		});
		return false;
	});
}
$(document).ready(function() {
	bindAjaxLink();
});
</script>
<a name='waiting'></a>
<h1 class="title"><?php echo $html->image('front/'. __("title_menu_list.jpg", true))?></h1>
	<div class="top_conner">
	</div>
	<div class="content_list_menu">
		<div class="detail_menu">
			
			<div id='food_detail'>
			<?php echo $this->element('view_detail', array('plugin' => 'foods', 'detail' => $detail))?>
			</div>
			<!-- Start Carousel Gallery -->
			<div class="carousel_gallery" id='food_items'>
				<a href="#" class="prev"> &nbsp; </a>
				<div class="jCarouselLite_gallery">
					<ul id="mycarousel_gallery">
						<?php foreach ($other as $item):?>	
							<li>
								<div class="boxgrid captionfull">
								<a class='ajax_link' href="<?php echo $html->url(array('plugin' => 'foods', 'controller' => 'foods', 'action' => 'ajax_foods_view_detail', $category_alias, $item['Food']['alias']));?>">
									<?php 
										if(isset($item['Food']['image'])):
									?>
										<img src="<?php echo $html->url("/".$configs['Food']['thumbnail']['uri'].$html->getThumbnailName($item['Food']['image'])) ?>" alt="<?php echo $item['ExtraFoodField']['alias'] ?>" />
									<?php 
									    else:
									?>
										<img src="<?php echo $html->url("/".$configs['Food']['thumbnail']['uri'].'no_image.gif') ?>" alt="<?php echo $item['ExtraFoodField']['alias'] ?>" />
									<?php endif;?>
								</a>
								</div>
							<p class="title_discover_list"><?php echo $item['Food']['title']; ?></p>
							</li>
						<?php endforeach;?>
					</ul>
				</div>
				<a href="#" class="next"> &nbsp; </a>
				<div class="clear"></div>   
			</div>
			<!-- End Carousel Gallery-->
		</div>
		<ul class="right_menu">
			<?php foreach ($food_categories as $category):
					$link = array('plugin' => 'foods', 'controller' => 'foods', 'action' => 'detail') + array($category['FoodCategory']['alias']);
					$url = array('plugin' => 'foods', 'controller' => 'foods', 'action' => 'detail_other');
					$classUrl = $url + array('pass' => array($category['FoodCategory']['alias']));
					$linkUrl = $url + array($category['FoodCategory']['alias']);
					
					if($category['FoodCategory']['alias'] == $this->params['pass'][0]){
						$class = 'current';
					}else{
						$class = '';
					}
					//debug($linkUrl); exit;
			?>
						<li><a class='<?php echo $class?>' href="<?php echo $html->url($link)?>"> <?php echo $category['FoodCategory']['name']; ?> </a></li>
			<?php endforeach;?>	
		</ul>
		<div class="image_abinfo_menu">
		</div>
	</div>
	<div class="bottom_conner">
	</div>